/*! \file Handle.h
 *	\brief <write description for Handle.h>
 *
 *	created:	2010/11/23
 *	created:	23:11:2010   10:14
 *	filename: 	C:\src\tactics-engine\libs\utils\Handle.h
 *	file path:	C:\src\tactics-engine\libs\utils
 *	file base:	Handle
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				vitalii.trubchaninov@ubisoft.com
 */

#ifndef _utils_HANDLE_H_
#define _utils_HANDLE_H_

#pragma once

namespace tt{
namespace utils{

class Handle
{
public:
	explicit Handle(HANDLE handle = INVALID_HANDLE_VALUE);
	~Handle();

	bool valid() const;

	void reset(HANDLE handle = INVALID_HANDLE_VALUE);
	void swap(Handle&);

	operator HANDLE() const;
	operator bool() const;

private:
	Handle(const Handle&);
	Handle& operator=(const Handle&);

private:
	HANDLE m_handle;
};

} //namespace utils
} //namespace tt
#include "Handle.inl"

#endif //_utils_HANDLE_H_